type List = string[]

/**
 * 获取 delList, addList
 * @param newList
 * @param oldList
 * @returns
 */
export function useAddDelList(
  newList: RefSource<List>,
  oldList: RefSource<List>
) {
  const newVal = getSource(newList)
  const oldVal = getSource(oldList)

  const delList = computed(() =>
    oldVal.value.filter(v => !newVal.value.includes(v))
  )

  const addList = computed(() =>
    newVal.value.filter(v => !oldVal.value.includes(v))
  )

  return { delList, addList }
}
